#ifndef WINDOWHELP4GL_20171019
#define WINDOWHELP4GL_20171019

#include <windows.h>
#include <GL/gl.h>

class WindowHelp4GL
{
public:
    WindowHelp4GL();
    ~WindowHelp4GL();

protected:
    HWND    m_hwnd;
    HDC     m_hdc;
    HGLRC   m_glrc;

private:
    LPCTSTR  MyRegisterlpszClassName;

#define UserDataNumber 4
    typedef void* EveryData;
    EveryData m_data[UserDataNumber];

public:
    bool createGLWindow(HINSTANCE hinstance,LPCTSTR title,int pos_x,int pos_y,int width,int height);

private:
    ATOM MyRegisterClass(HINSTANCE hinstance,LPCTSTR className,LPCTSTR menuName = NULL);

    HWND MyCreateWindow(HINSTANCE hinstance,LPCTSTR className,LPCTSTR title,
                    int pos_x = 0,int pos_y = 0,int width = 800,int heigth = 600);

    HGLRC initPixelformat4GL(HDC hdc);

    void resizeGLScene(const GLsizei width,const GLsizei height);
    void initGLParameters();

private:
    static WindowHelp4GL* WindowHelp4GLInstance;

public:
    static WindowHelp4GL* getInstance(){return WindowHelp4GLInstance;}

public:
    HWND getHelpHWND(){return m_hwnd;}
    HDC getHelpDC(){return m_hdc;}
    HGLRC getHelpHGLRC(){return m_glrc;}
    void setData(EveryData data,unsigned int index)
    {
        if(index < UserDataNumber){m_data[index] = data; }
    }

    EveryData getData(unsigned int index)
    {
        if(index < UserDataNumber){return m_data[index];}
    }
};


#endif // WINDOWHELP4GL_20171019
